package com.atguigu.daijia.driver.chain.chainHolder;

import com.atguigu.daijia.driver.chain.StartServiceChain;
import com.atguigu.daijia.driver.chain.StopServiceChain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 山顶洞人郑某
 * @className StopServiceHolder.java
 * @date 2024 09 13
 */
@Component
public class StopServiceHolder {
    @Autowired
    private List<StopServiceChain> stopServiceChains = new ArrayList<>();

    //开始接单业务 执行责任链上的每个服务应该做的事情
    public  void stopSercice(Long driverId) {
        for (StopServiceChain startServiceChain : stopServiceChains) {
            startServiceChain.stopService(driverId);
        }
    }
}
